<?php
/*
 *      index.php
 *      
 *      Copyright 2011 Vitaliy Rakitin <virak@ukr.net>
 *      
 *      This program is free software; you can redistribute it and/or modify
 *      it under the terms of the GNU General Public License as published by
 *      the Free Software Foundation; either version 2 of the License, or
 *      (at your option) any later version.
 *      
 *      This program is distributed in the hope that it will be useful,
 *      but WITHOUT ANY WARRANTY; without even the implied warranty of
 *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *      GNU General Public License for more details.
 *      
 *      You should have received a copy of the GNU General Public License
 *      along with this program; if not, write to the Free Software
 *      Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
 *      MA 02110-1301, USA.
 */

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

<head>
	<title>Без имени</title>
	<meta http-equiv="content-type" content="text/html;charset=utf-8" />
	<meta name="generator" content="Geany 0.20" />
	<script type='text/javascript' src='ajax.js'></script>
</head>

<body>
	
	
<?php
require_once($_SERVER['DOCUMENT_ROOT']."/classes/metadata/osmetadata.php");
require_once($_SERVER['DOCUMENT_ROOT']."/classes/System/osdata.php");
//session_start();
/*
	require_once("edit.php");
	session_start();
	$edit1 = new edit("uuid1815ecd6cd133026ce44c905ee5a70f6");
	echo $edit1->form();
	$edit2 = new edit("uuid1915ecd6cd133026ce44c905ee5a70f6");
	//echo $edit2->form();
	$name = "Вася";
	//${$name} = function() use (&$edit2) {return $edit2;};
	${$name} = new edit("uuid1915ecd6cdf33026ce44c905ee5a70f6");
	
	foreach($Вася() as $a) {
		echo $a;
	}
	
	echo $Вася();
*/
	
	//$dic = $data->dictionaries->byname("Товар");
	$dic = $data->dictionaries->Товар;
	//echo "<pre>".print_r($dic,1)."</pre>";
	echo $dic->name;
	$item = $dic->additem();
	$item->Наименование = "Тетрадь";
	//$item->isedit();
	//$item->fields->byname("Наименование")->value = "Тетрадь";
	//$item->fields->byname("ЦенаП")->value = "12.23";
	echo "<pre>".print_r($dic,1)."</pre>";
	//$item->Наименование = "Тетрадь";
	//$dic->deleteitem(false);
	//cho $dic->saveitem();
	
	$save = $dic->saveitem();
	echo "<pre>".print_r($save,1)."</pre>";
	$dic->openitem($save);
	echo "<pre>".print_r($dic,1)."</pre>";
	//echo "<pre>".print_r(serialize($item),1)."</pre>";
	//$item->save();
	//$item2 = $dic->items->add();
	//$item3 = $dic->items->add();
	//echo "Словарь удален? - ";
	//echo $dic->items->delete($item2->uuid) ? "Да": "Нет";
	//echo "<pre>".print_r($_SESSION,1)."</pre>";
?>
</body>

</html>
